#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>
#include<stdbool.h>

bool leap(int x)
{
    if (x % 400 == 0 || (x % 4 == 0 && x % 100 != 0))
        return true;
    return false;
}
int main()
{
    int m, n;
    scanf("%d%d", &m, &n);
    int count = 0;
    int find = 0;
    for (int i = m; i <= n; i++)
    {
        if (leap(i))
        {
            printf("%6d", i);
            find = 1;
            count++;
            if (count % 5 == 0)
                printf("\n");
        }
    }
    if (!find)
        printf("None\n");
    return 0;
}